/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.server;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;


// TODO: Auto-generated Javadoc
/**
 * The Class JDOUser.
 */
@PersistenceCapable
public class JDOUser {

	/** The key. */
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	//@Persistent
	//private long id;
    /** The name. */
	@Persistent
    private String name;
    
    /** The email. */
    @Persistent
	private String email;
    
    /** The nickname. */
    @Persistent
	private String nickname; // from google
	
	/** The access token. */
	@Persistent
	private String accessToken;
	
	/** The access token secret. */
	@Persistent
	private String accessTokenSecret;
	
	
	/**
	 * Instantiates a new jDO user.
	 *
	 * @param key the key
	 * @param username the username
	 * @param email the email
	 * @param nickname the nickname
	 */
	public JDOUser(Key key, String username, String email, String nickname) {
		this.key = key;
		this.name = username;
		this.email = email;
		this.nickname = nickname;
	}
	
	/**
	 * Sets the access token secret.
	 *
	 * @param secret the new access token secret
	 */
	public void setAccessTokenSecret(String secret) {
		this.accessTokenSecret = secret;
	}
	
	/**
	 * Gets the access token secret.
	 *
	 * @return the access token secret
	 */
	public String getAccessTokenSecret() {
		return this.accessTokenSecret;
	}
	
	/**
	 * Sets the access token.
	 *
	 * @param token the new access token
	 */
	public void setAccessToken(String token) {
		this.accessToken = token;
	}
	
	/**
	 * Gets the access token.
	 *
	 * @return the access token
	 */
	public String getAccessToken() {
		return this.accessToken;
	}
	
	/**
	 * Gets the key.
	 *
	 * @return the key
	 */
	public Key getKey() {
		return this.key;
	}
	
	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return this.name;
	}
	
	/**
	 * Gets the email.
	 *
	 * @return the email
	 */
	public String getEmail() {
		return this.email;
	}
	
	/**
	 * Gets the nickname.
	 *
	 * @return the nickname
	 */
	public String getNickname() {
		return this.nickname;
	}
}
